.class Lorg/apache/cordova/WqCordovaActivity$2;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/widget/TextView$OnEditorActionListener;


# instance fields
.field final synthetic this$0:Lorg/apache/cordova/WqCordovaActivity;


# direct methods
.method constructor <init>(Lorg/apache/cordova/WqCordovaActivity;)V
    .locals 0

    iput-object p1, p0, Lorg/apache/cordova/WqCordovaActivity$2;->this$0:Lorg/apache/cordova/WqCordovaActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z
    .locals 4

    const/4 v0, 0x0

    const/4 v1, 0x3

    if-eq p2, v1, :cond_0

    if-nez p2, :cond_1

    :cond_0
    iget-object v1, p0, Lorg/apache/cordova/WqCordovaActivity$2;->this$0:Lorg/apache/cordova/WqCordovaActivity;

    iget-object v1, v1, Lorg/apache/cordova/WqCordovaActivity;->callbackSearchMenu:Lorg/apache/cordova/CallbackContext;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lorg/apache/cordova/WqCordovaActivity$2;->this$0:Lorg/apache/cordova/WqCordovaActivity;

    # getter for: Lorg/apache/cordova/WqCordovaActivity;->searchEditText:Landroid/widget/EditText;
    invoke-static {v1}, Lorg/apache/cordova/WqCordovaActivity;->access$400(Lorg/apache/cordova/WqCordovaActivity;)Landroid/widget/EditText;

    move-result-object v1

    invoke-virtual {v1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v1

    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2}, Lorg/json/JSONObject;-><init>()V

    :try_start_0
    const-string/jumbo v3, "position"

    invoke-virtual {v2, v3, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    iget-object v1, p0, Lorg/apache/cordova/WqCordovaActivity$2;->this$0:Lorg/apache/cordova/WqCordovaActivity;

    iget-object v1, v1, Lorg/apache/cordova/WqCordovaActivity;->callbackSearchMenu:Lorg/apache/cordova/CallbackContext;

    invoke-virtual {v1, v2}, Lorg/apache/cordova/CallbackContext;->success(Lorg/json/JSONObject;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    const/4 v0, 0x1

    :cond_1
    :goto_0
    return v0

    :catch_0
    move-exception v1

    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0
.end method
